'use strict';
(function() {

	//注册路由
    ngApp.config(['$stateProvider', '$urlRouterProvider', 'AppConfigConstant', function($stateProvider, $urlRouterProvider, AppConfigConstant) {

        var basePath = AppConfigConstant.APP_BASE_PATH;

        var apphome = "/main/app/server";
        var mahome = "/main/ma/server";

        $urlRouterProvider.when("", apphome)
        				  .when("/", apphome)
        				  .when("/main", apphome)
        				  .when("/main/app", apphome)
        				  .when("/main/ma", mahome);
        
        $stateProvider.state("main", {url: "/main", templateUrl: basePath + "main/view/main.html"});//主页面
        
        
        $stateProvider.state("main.ma", {url: "/ma", templateUrl: basePath + "ma/view/ma.html"});
        //MA服务器列表页面
        $stateProvider.state("main.ma.server", {url: "/server", templateUrl: basePath + "maserver/view/maserver.html"});
        //用户列表页面
        $stateProvider.state("main.ma.monitor", {url: "/monitor?ip&port", templateUrl: basePath + "mamonitor/view/mamonitor.html"});
        //日志列表页面
        $stateProvider.state("main.ma.log", {url: "/log?ip&port&monitor", templateUrl: basePath + "malog/view/malog.html"});
        //日志详情页面
        $stateProvider.state("main.ma.loginfo", {url: "/loginfo?ip&port&monitor&name", templateUrl: basePath + "maloginfo/view/maloginfo.html"});
        
        
        $stateProvider.state("main.app", {url: "/app", templateUrl: basePath + "app/view/app.html"});
        //MA服务器列表页面
        $stateProvider.state("main.app.server", {url: "/server", templateUrl: basePath + "appserver/view/appserver.html"});
        //用户列表页面
        $stateProvider.state("main.app.monitor", {url: "/monitor?ip&port", templateUrl: basePath + "appmonitor/view/appmonitor.html"});
        //日志列表页面
        $stateProvider.state("main.app.log", {url: "/log?ip&port&monitor", templateUrl: basePath + "applog/view/applog.html"});
        //日志详情页面
        $stateProvider.state("main.app.loginfo", {url: "/loginfo?ip&port&monitor&name", templateUrl: basePath + "apploginfo/view/apploginfo.html"});
        
    }]);

})();